package com.lean.android.ad.utils

import android.content.Context
import android.content.Intent
import android.net.Uri
import com.lean.android.ad.activity.SimpleWebViewActivity


/**
 * @author: Created by zfj
 * created on: 2023/10/18
 * description:
 */
object JumpHelper {
    fun jump(context: Context, jumpType: String, jumpUrl: String) {
        when (jumpType) {
            "1" -> { // h5
                SimpleWebViewActivity.launch(context, jumpUrl)
            }

            "2" -> { // 应用商店
                com.lean.android.ad.utils.MarketUtils.getTools().startMarket(context, jumpUrl)
            }

            "3" -> { // 快应用
                val quickAppUri = "hap://app/${jumpUrl}" // 快应用的 包名
                val intent = Intent(Intent.ACTION_VIEW)
                intent.data = Uri.parse(quickAppUri)
                context.startActivity(intent)
            }
        }
    }

}